package com.atguigu.tingshu.account.client;

import com.atguigu.tingshu.account.client.impl.UserAccountDegradeFeignClient;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.vo.account.AccountLockResultVo;
import com.atguigu.tingshu.vo.account.AccountLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-account", path = "/api/account/rpc", fallback = UserAccountDegradeFeignClient.class)
public interface UserAccountFeignClient {

    /**
     * [rpc]
     * 根据锁定金额对象
     * 去数据库中锁定account的金额
     * 并判断用户的余额是否支持支付
     * @param accountLockVo 锁定信息对象
     * @return
     */
    @PostMapping("/checkAndLockAccountMoney")
    Result<AccountLockResultVo> checkAndLockAccountMoney(@RequestBody AccountLockVo accountLockVo);
}